<?php
// load the theme options
$options = get_option( 'complete_theme_settings' );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

<title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' :'; } ?> <?php bloginfo('name'); ?></title>

<!-- Stylesheet and Favicon -->
<link rel="icon" type="image/png" href="<?php echo $options['upload_favicon']; ?>" />
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
<?php if (is_page_template( 'template-portfolio.php' ) || is_tax()) { ?>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory') ?>/css/prettyphoto.css" />
<?php } ?>

<!-- Color Skins -->
<?php if($options['theme_color'] != '') { ?>
	<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory') ?>/skins/<?php echo $options['theme_color']; ?>.css" />
<?php } ?>
<?php
// get the file that outputs all custom colors
include( TEMPLATEPATH . '/includes/custom-colors.php'); ?>

<!-- Google Fonts -->
<?php
// get the file that outputs all custom fonts
include( TEMPLATEPATH . '/includes/custom-fonts.php'); ?>


<!-- WP Head -->
<?php
//loads comment reply JS on single posts and pages
if ( is_single() || is_page() ) wp_enqueue_script( 'comment-reply' ); ?>
<?php wp_head(); ?>

<?php
//loads scripts for homepage
if (is_front_page()) { ?>
<script type="text/javascript">
	jQuery(function($){
		$(window).load(function() {
			//homepage image slider
			$('#slider').nivoSlider({
				directionNav: <?php if($options['slider_disable_navigation'] == true ) { echo 'false'; } else { echo 'true'; } ?>,
				directionNavHide: <?php if($options['slider_hide_navigation'] == true ) { echo 'true'; } else { echo 'false'; } ?>,
				captionOpacity: <?php if($options['slider_caption_opacity'] == true ) { echo 'false'; } else { echo '0.8'; } ?>,
				boxCols: <?php if($options['slider_box_columns'] == true ) { echo 'false'; } else { echo '8'; } ?>,
				boxRows: <?php if($options['slider_box_rows'] == true ) { echo 'false'; } else { echo '4'; } ?>,
				effect: '<?php if($options['slider_effect'] != '') { echo $options['slider_effect']; } else { echo 'fade'; } ?>',
				slices: <?php if($options['slider_slices_'] != '') { echo $options['slices']; } else { echo 15; } ?>,
				animSpeed: <?php if($options['slider_animation_speed'] != '') { echo $options['slider_animation_speed']; } else { echo 500; } ?>,
				pauseTime: <?php if($options['slider_pause_time'] != '') { echo $options['pause_time']; } else { echo 3000; } ?>,
				controlNav: false
			});
			//homepage portfolio carousel
			$('#homepage-portfolio').bxSlider({
				displaySlideQty: 4,
				speed: <?php if($options['home_portfolio_carousel_speed'] != '') { echo $options['home_portfolio_carousel_speed']; } else { echo '500'; } ?>,
				prevText: 'prev',
				nextText: 'next' ,
				moveSlideQty: <?php if($options['home_portfolio_carousel_quantity'] != '') { echo $options['home_portfolio_carousel_quantity']; } else { echo '4'; } ?>      
			});
		});
	});
</script>
<?php } ?>

<?php
//loads local scroll for single pages
if (is_single()) { ?>
<script type="text/javascript">
	jQuery(function($){
		$(document).ready(function(){
			//Scrollto Local
			$.localScroll({
				queue: true,
				duration: 1000
			});
		});
	});
</script>
<?php } ?>

<?php
//loads scripts for portfolio page
if(is_page_template( 'template-portfolio.php' ) || is_tax()) { ?>
<script type="text/javascript" charset="utf-8">
	jQuery(function($){
		$(document).ready(function(){
			//PrettyPhoto
			$(".portfolio-box a[rel^='prettyPhoto']").prettyPhoto({
				animation_speed:'normal',
				allow_resize: true,
				keyboard_shortcuts: true,
				show_title: false,
				slideshow: <?php if($options['lightbox_transition_speed'] != '') { echo $options['lightbox_transition_speed']; } else { echo 5000; } ?>,
				social_tools: false,
				autoplay_slideshow: true
			});
		});
	});
</script>
<?php } ?>
<?php if (is_page_template( 'template-pricing.php') || is_page_template( 'template-portfolio.php') || is_tax()) { ?>
<script type="text/javascript" charset="utf-8">
	jQuery(function($){
		$(document).ready(function(){
			//equal hights
			equalHeight($(".service-inner,.portfolio-box, .pricing-plan-features"
			));
		});
	});
</script>
<?php } ?>

<?php 
// show tracking code for the header
echo stripslashes($options['tracking_header']); 
?>

</head>

<body>

<div id="header-wrap">
    <div id="header" class="clearfix">
        <div id="logo">
			<?php if($options['upload_mainlogo']) { ?>
            <a href="<?php bloginfo( 'url' ) ?>/" title="<?php bloginfo( 'name' ) ?>" rel="homepage">
            <img src="<?php echo $options['upload_mainlogo']; ?>" alt="<?php bloginfo( 'name' ) ?>" />
            </a>
            <?php } else { ?>
			<?php if (is_front_page()) { ?>
            <h1><a href="<?php bloginfo( 'url' ) ?>/" title="<?php bloginfo( 'name' ) ?>" rel="homepage"><?php bloginfo( 'name' ) ?></a></h1>
            <?php } else { ?>
            <h2><a href="<?php bloginfo( 'url' ) ?>/" title="<?php bloginfo( 'name' ) ?>" rel="homepage"><?php bloginfo( 'name' ) ?></a></h2>
            <?php } } ?>
        </div>
    	<!-- END logo -->  
        <div id="navigation" class="clearfix">
			<?php
            //define main navigation
            wp_nav_menu( array(
            	'theme_location' => 'main nav',
            	'sort_column' => 'menu_order',
            	'menu_class' => 'sf-menu',
            	'fallback_cb' => 'default_menu'
            )); ?>
        </div>
   		<!-- END navigation -->  
    </div>
	<!-- END header -->
</div>
<!-- END header-wrap -->

<?php if (is_front_page()) { ?>
<?php include( TEMPLATEPATH . '/includes/sliders/slider-nivoslider.php'); ?>
<?php } ?>
<div id="wrap">